package org.ecc.android.validations.library.validator;

import android.content.Context;

import org.ecc.android.validations.library.ValidationExecutor;

import java.util.regex.Pattern;

/**
 * Created with org.ecc.android.validations.library.validator
 * User:YangXiuFeng
 * Date:2016/1/14
 * Time:20:20
 */
public class PhoneValidation extends ValidationExecutor{
    final String REGEX_MOBILE = "^((13[0-9])|(15[^4,\\D])|(18[0,2,5-9]))\\d{8}$";

    @Override
    public boolean doValidate(Context context, String text) {
        if(Pattern.compile(REGEX_MOBILE).matcher(text).find()){
            return true;
        }
        return false;
    }
}
